import { MidwayConfig } from '@midwayjs/core';
import  privateconfig from "../private/clienconfig"
export default {
  // use for cookie sign key, should change to your own and keep security
  keys: '1670401086084_3129',
  koa: {
    port: 7001,
  },
  typeorm:{
    dataSource: {
      default: {
        type: 'mysql',
        host: '127.0.0.1',
        port: 3306,
        username: 'root',
        password: 'root123',
        database: 'smb',
      
        // 自动建表 注意：线上部署的时候不要使用，有可能导致数据丢失
        synchronize: true,
        //  每次启动项目, 一旦 实体中的表更改了 就重建
        // 打印日志
        logging: false,

        driver: require('mysql2'),
        // 字符集
        charset: 'utf8mb4', // 支持表情包
        // 驱动
        // driver: require('mysql2'),
        // 设置时区
        // timezone: '+8:00',
          entities: '/entity',
          //  匹配src 目录下的 entity下的所有实体
        // entities: [Photo], 
      }
    }
  },
  bull:{
    defaultQueueOptions: {
      redis: {
        port: 6379,
        host: '127.0.0.1',
        password: 'allen',
      },
    }
  },
  redis:{
    client: {
      port: 6379, // Redis port
      host: "127.0.0.1", // Redis host
      password: "allen",
      db: 1,
    },
  },

  oss: {
    // normal oss bucket
    client: {
      accessKeyId: privateconfig.accessKeyId,
      accessKeySecret: privateconfig.accessKeySecret,
      bucket: privateconfig.bucket,
      endpoint: privateconfig.endpoint,
      timeout: '60s',
    },
  },
  swagger: {
    auth: {
      authType: 'bearer',
    },
  },
} as MidwayConfig;
